<?php
/*
 * @Description: 
 * @Author: Leequik
 * @Date: 2023-05-11 19:34:44
 * @LastEditTime: 2024-01-04 18:20:54
 * @LastEditors: Leequik
 */


echo 'index';
print_r($name)
?>
{{$job}}
<html>
  <head>
    <meta charset="utf-8">
    <title></title>
    <script src="jquery-3.1.1.js" charset="utf-8"></script>
    <script type="text/javascript">
      //全局配置
      $.ajaxSetup({
        beforeSend: function(jqXHR, settings) {
            //在请求前给修改url（增加一个时间戳参数）
            settings.url += settings.url.match(/\?/) ? "&" : "?";
            settings.url += "token=" + new Date().getTime();
        },
      });
 
      //按钮点击响应
      function btnClick() {
        $.get("data.php", {name: "hangge"}, function(data){
          alert(data);
        });
      }
    </script>
  </head>
  <body>
    <input type="button" value="请求数据" onclick="btnClick()"/>
  </body>
</html>
